package com.x.controller;

import com.x.websocket.WebSocketClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * .
 *
 * @author o_o
 * @date 2024-06-09
 */
@RestController
public class WebSocketController {

    @Autowired
    private WebSocketClient webSocketClient;

    @RequestMapping("/send")
    public String send(@RequestParam(name = "msg") String msg) {
        webSocketClient.sendMessage(msg);
        return "success.";
    }


}
